<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>跳转1遍</title>
    <script>
        window.onload= function () {
            var link=document.getElementById("link");
            var timerId=null;
            var num=5;
            timerId=setInterval(function () {
                num--;
                link.innerText="注册成功,"+num+"秒后跳转到首页";
                if(num==0){
                    clearInterval(timerId);
                    location.href=link.href;
                }
            },1000)
        }
    </script>
</head>
<body>
<a href="http//:www.baidu.com" id="link"> 注册成功，5秒后跳转到首页</a>
</body>
</html>